<template>
  <div>
    <div class="slot">
      <div class="top">
        <div class="return" @click="goback">
          <img src="@/assets/my/zuo.png" alt />
        </div>
        <span>商家资料</span>
      </div>
    </div>
    <div class="main">
      <div class="tu">
        <img :src="userinfo.avatar" alt />
      </div>
      <div class="ul">
        <div class="li">
          <div class="p1">商家姓名</div>
          <div class="p2">{{userinfo.nickname}}</div>
        </div>
        <div class="li">
          <div class="p1">商家编号</div>
          <div class="p2">{{userinfo.store.sign}}</div>
        </div>
        <div class="li">
          <div class="p1">商家地址</div>
          <div class="p2">{{userinfo.store.province}}{{userinfo.store.city}}{{userinfo.store.area}}{{userinfo.store.detail}}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      userinfo:{},
      token:""
    };
  },
  methods: {
    goback() {
      this.$router.back();
    },
  },
  mounted() {
    this.token = window.localStorage.getItem("token")
    axios.post("/index/user/info", this.$qs.stringify({ token: this.token })).then((res) => {
      console.log(res.data);
      if (res.data.code === 1) {
        this.userinfo = res.data.data.user;
      } else {
        this.$toast(res.data.msg);
      }
    });
  },
};
</script>

<style lang="scss" scoped>
.slot {
  width: 100%;
  height: 44px;
  .top {
    width: 100%;
    height: 44px;
    display: flex;display: -webkit-flex;
    justify-content: center;
    align-items: center;
    background: white;
    position: fixed;
    top: 0;
    left: 0;
    .return {
      width: 38px;
      height: 100%;
      position: absolute;
      top: 0;
      left: 0;
      display: flex;display: -webkit-flex;
      justify-content: center;
      align-items: center;
      img {
        width: 8px;
        height: 15px;
      }
    }
    span {
      font-size: 18px;
      font-family: PingFang SC;
      font-weight: bold;
      color: #000000;
      line-height: 44px;
    }
  }
}
.main {
  width: 100%;
  .tu {
    width: 100%;
    height: 130px;
    display: flex;display: -webkit-flex;
    justify-content: center;
    align-items: center;
    img {
      width: 90px;
      height: 90px;
      border-radius: 50%;
    }
  }
  .ul {
    width: 345px;
    margin: auto;
    .li {
      width: 100%;
      padding-bottom: 15px;
      border-bottom: 1px solid #f8f8f8;
      .p1 {
        font-size: 12px;
        font-family: PingFang SC;
        font-weight: 500;
        color: #bcbcbc;
        line-height: 12px;
        margin-top: 25px;
      }
      .p2 {
        font-size: 16px;
        font-family: PingFang SC;
        font-weight: 500;
        color: #222222;
        line-height: 24px;
        margin-top: 15px;
      }
    }
  }
}
</style>